package cl.jpavlich.mpm.services;

import java.util.Enumeration;
import java.util.ResourceBundle;

public class Bundle extends ResourceBundle {
	private ResourceBundle bundle = ResourceBundle.getBundle("cl.jpavlich.mpm.view.config.Locale");

	private static Bundle instance = new Bundle();
	
	private static final String NOT_FOUND = "???";

	private Bundle() {
		
	}
	
	public static ResourceBundle getInstance() {
		return instance;
	}
	
	@Override
	protected Object handleGetObject(String key) {
		if (bundle.containsKey(key)) {
			return bundle.getString(key);
		} else {
			return NOT_FOUND + key + NOT_FOUND;
		}
	}


	@Override
	public Enumeration<String> getKeys() {
		return bundle.getKeys();
	}

}
